<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>图片转换</title>
    <link rel="stylesheet" href="./static/css/togglePicture.css">
</head>
<body>
    <!-- 2.html结构 -->
    <div id="mask">
        <div class="center">
            <h2 class="title">
                <img src="./static/images/logo.png" alt=""/>
                EnjoyToShare-樱花展
            </h2>
            <!--图片-->
            <!--<img src="./static/images/00.jpg" alt=""/>-->
            <img :src="imgArr[index]" alt=""/>
            <!--左箭头-->
            <a href="javascript:void(0)" v-show="index!=0" @click="prev" class="left">
                <img src="./static/images/prev.png" alt=""/>
            </a>
            <!--右箭头-->
            <a href="javascript:void(0)" v-show="index<imgArr.length-1" @click="next" class="right">
                <img src="./static/images/next.png" alt=""/>
            </a>
        </div>

    </div>
    <!-- 1.开发环境版本，包含了有帮助的命令行警告 -->
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
        //  3.创建Vue实例
        var app = new Vue({
            el:"#mask",//el:挂载点 id选择器
            data:{
                imgArr:[
                    "./static/images/00.jpg",
                    "./static/images/01.jpg",
                    "./static/images/02.jpg",
                ],
                index:0

            },
            methods:{
                prev:function () {
                    this.index--;
                },
                next:function () {
                    this.index++;
                }
            }
        })
    </script>
</body>
</html>
